package cn.edu.zafu.bigdata.bd121.student.command.impl;

import cn.edu.zafu.bigdata.bd121.student.cli.CliMain;
import cn.edu.zafu.bigdata.bd121.student.command.BaseCommand;
import cn.edu.zafu.bigdata.bd121.student.entity.StudentPO;
import cn.edu.zafu.bigdata.bd121.student.utils.InputUtils;

/**
 * 插入学生信息命令
 *
 * @author 202211090121
 */
public class InsertStudent extends BaseCommand {

    /**
     * 处理用户输入
     */
    @Override
    protected void handleUserInput() {
        String id = InputUtils.getValidId(true);
        String name = InputUtils.getValidName();
        String phone = InputUtils.getValidPhone();

        CliMain.studentList.add(new StudentPO(id, name, phone));
        System.out.println("学生信息添加成功！");
    }

}
